<template>
	<view class="content">
		<view :style='{"alignContent":"flex-start","alignItems":"flex-start","flexWrap":"wrap","background":"url(http://codegen.caihongy.cn/20241029/d192bff62bc241578876b935312772da.png) no-repeat center top / 100% auto,#f8f8f8","display":"flex","width":"100%","height":"auto"}'>
			<view class="list-swiper-4" :style='{"width":"calc(100% - 48rpx)","margin":"20rpx auto","position":"relative","height":"360rpx"}' @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd">
				<view :style='{"top":"0%","borderRadius":"32rpx","left":"0%","background":"none","width":"100%","position":"absolute","height":"360rpx"}' class="item animate__animated" :class="prevNumList4 == index  ? 'animate__fadeOutRight' : (numList4 == index  ? 'animate__fadeInLeft' : '')" v-for="(swiper,index) in swiperList" :key="index" v-if="numList4 == index || prevNumList4 == index">
					<image :style='{"width":"100%","objectFit":"cover","borderRadius":"32rpx","display":"block","height":"360rpx"}' mode="aspectFill" :src="baseUrl+swiper.img" @tap="onSwiperTap(swiper)"></image>
					<view :style='{"padding":"8rpx 20rpx","margin":"-20rpx 0 0 0","transform":"translate3d(-50%, -50%, 0)","top":"50%","color":"#000","left":"50%","background":"rgba(255, 255, 255, 0.3)","display":"none","lineHeight":"1.5","fontSize":"40rpx","position":"absolute"}'>{{ swiper.title }}</view>
				</view>
				<view class="animate__navigation" :style='{"alignItems":"center","left":"0%","bottom":"20rpx","background":"rgba(0,0,0,0)","display":"flex","width":"100%","position":"absolute","justifyContent":"center","height":"40rpx"}'>
					<block v-for="(swiper,index) in swiperList" :key="index">
						<text class="navigation-item" v-if="numList4 == index" :style='{"width":"16rpx","margin":"0 4rpx","borderRadius":"100%","background":"#23baf7","height":"16rpx"}'></text>
						<text class="navigation-item" v-if="numList4 != index" :style='{"width":"16rpx","margin":"0 4rpx","borderRadius":"100%","background":"#fff","height":"16rpx"}'></text>
					</block>
				</view>
			</view>
			<!-- menu -->
			<view v-if="true" class="menu_view">
				<block v-for="(item,index1) in menuList" v-bind:key="item.roleName">
					<block v-if="index1==0" v-bind:key="index" v-for=" (menu,index) in item.frontMenu">
						<block v-bind:key="sort" v-for=" (child,sort) in menu.child">
							<block v-bind:key="sort2" v-for=" (button,sort2) in child.buttons">
								<view class="menu-item" v-if="button=='查看' && child.tableName!='yifahuodingdan' && child.tableName!='yituikuandingdan' &&child.tableName!='yiquxiaodingdan' && child.tableName!='weizhifudingdan' && child.tableName!='yizhifudingdan' && child.tableName!='yiwanchengdingdan' " @tap="onPageTap2(child.tableName)">
									<view class="iconarr" :class="child.appFrontIcon" :style="{'background':menuColor[index]}"></view>
									
									<view class="text">{{child.menu.split("列表")[0]}}</view>
								</view>
							</block>
						</block>
					</block>
				</block>
			</view>
			<!-- 商品推荐 -->
			<view class="listBox recommend" :style='{"width":"100%","padding":"0 24rpx","margin":"40rpx auto","background":"none","order":"4"}'>
				<view class="title" :style='{"padding":"0 0 0 20rpx","margin":"0 0 40rpx","borderColor":"#23baf7","textAlign":"left","background":"none","borderWidth":"0 0 0 12rpx","width":"100%","position":"relative","borderStyle":"solid","fontWeight":"600"}'>
					<view :style='{"color":"#23baf7","fontSize":"48rpx"}'>景点信息推荐</view>
				</view>
				<!-- 样式1 -->
				<view class="list-box style1" :style='{"width":"100%","columnCount":"2","columnGap":"30rpx","height":"auto"}'>
					<view @tap="onDetailTap('scenicspotinformation',product.id)" v-for="(product,index) in scenicspotinformationlist" :key="index" class="list-item" :style='{"padding":"0 0 20rpx","margin":"0 0 40rpx","borderRadius":"20rpx","flexWrap":"wrap","background":"#fff","display":"flex","width":"auto","height":"auto"}'>
						<view :style='{"padding":"0 20rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#000","width":"100%","lineHeight":"1.8","fontSize":"28rpx","textOverflow":"ellipsis"}' class="list-item-title ">{{product.scenicspotname}}</view>
						<view :style='{"padding":"0 20rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#000","width":"100%","lineHeight":"1.8","fontSize":"28rpx","textOverflow":"ellipsis"}' class="list-item-title ">{{product.scenicspotclassification}}</view>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-if="product.scenicspotimage.substring(0,4)=='http'" :src="product.scenicspotimage"></image>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-else :src="product.scenicspotimage?baseUrl+product.scenicspotimage.split(',')[0]:''"></image>
						<view :style='{"color":"#999","padding":"0 20rpx"}'>
							<text class="icon iconfont icon-shijian21" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.addtime.split(' ')[0].replace(/\-/g,'-')}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-shoucang10" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.storeupnum}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-chakan2" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.clicknum}}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="listBox recommend" :style='{"width":"100%","padding":"0 24rpx","margin":"40rpx auto","background":"none","order":"4"}'>
				<view class="title" :style='{"padding":"0 0 0 20rpx","margin":"0 0 40rpx","borderColor":"#23baf7","textAlign":"left","background":"none","borderWidth":"0 0 0 12rpx","width":"100%","position":"relative","borderStyle":"solid","fontWeight":"600"}'>
					<view :style='{"color":"#23baf7","fontSize":"48rpx"}'>店铺信息推荐</view>
				</view>
				<!-- 样式1 -->
				<view class="list-box style1" :style='{"width":"100%","columnCount":"2","columnGap":"30rpx","height":"auto"}'>
					<view @tap="onDetailTap('storeinformation',product.id)" v-for="(product,index) in storeinformationlist" :key="index" class="list-item" :style='{"padding":"0 0 20rpx","margin":"0 0 40rpx","borderRadius":"20rpx","flexWrap":"wrap","background":"#fff","display":"flex","width":"auto","height":"auto"}'>
						<view :style='{"padding":"0 20rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#000","width":"100%","lineHeight":"1.8","fontSize":"28rpx","textOverflow":"ellipsis"}' class="list-item-title ">{{product.storename}}</view>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-if="product.storeimage.substring(0,4)=='http'" :src="product.storeimage"></image>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-else :src="product.storeimage?baseUrl+product.storeimage.split(',')[0]:''"></image>
						<view :style='{"color":"#999","padding":"0 20rpx"}'>
							<text class="icon iconfont icon-shijian21" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.addtime.split(' ')[0].replace(/\-/g,'-')}}</text>
						</view>
						<view :style='{"color":"#999","width":"100%","padding":"0 20rpx"}'>
							<text class="icon iconfont icon-geren16" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.merchantaccount}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-shoucang10" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.storeupnum}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-chakan2" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.clicknum}}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="listBox recommend" :style='{"width":"100%","padding":"0 24rpx","margin":"40rpx auto","background":"none","order":"4"}'>
				<view class="title" :style='{"padding":"0 0 0 20rpx","margin":"0 0 40rpx","borderColor":"#23baf7","textAlign":"left","background":"none","borderWidth":"0 0 0 12rpx","width":"100%","position":"relative","borderStyle":"solid","fontWeight":"600"}'>
					<view :style='{"color":"#23baf7","fontSize":"48rpx"}'>美食信息推荐</view>
				</view>
				<!-- 样式1 -->
				<view class="list-box style1" :style='{"width":"100%","columnCount":"2","columnGap":"30rpx","height":"auto"}'>
					<view @tap="onDetailTap('foodinformation',product.id)" v-for="(product,index) in foodinformationlist" :key="index" class="list-item" :style='{"padding":"0 0 20rpx","margin":"0 0 40rpx","borderRadius":"20rpx","flexWrap":"wrap","background":"#fff","display":"flex","width":"auto","height":"auto"}'>
						<view :style='{"padding":"0 20rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#000","width":"100%","lineHeight":"1.8","fontSize":"28rpx","textOverflow":"ellipsis"}' class="list-item-title ">{{product.foodname}}</view>
						<view :style='{"padding":"0 20rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#000","width":"100%","lineHeight":"1.8","fontSize":"28rpx","textOverflow":"ellipsis"}' class="list-item-title ">{{product.foodclassification}}</view>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-if="product.foodimage.substring(0,4)=='http'" :src="product.foodimage"></image>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-else :src="product.foodimage?baseUrl+product.foodimage.split(',')[0]:''"></image>
						<view :style='{"color":"#999","padding":"0 20rpx"}'>
							<text class="icon iconfont icon-shijian21" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.addtime.split(' ')[0].replace(/\-/g,'-')}}</text>
						</view>
						<view :style='{"color":"#999","width":"100%","padding":"0 20rpx"}'>
							<text class="icon iconfont icon-geren16" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.merchantaccount}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-shoucang10" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.storeupnum}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-chakan2" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.clicknum}}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="listBox recommend" :style='{"width":"100%","padding":"0 24rpx","margin":"40rpx auto","background":"none","order":"4"}'>
				<view class="title" :style='{"padding":"0 0 0 20rpx","margin":"0 0 40rpx","borderColor":"#23baf7","textAlign":"left","background":"none","borderWidth":"0 0 0 12rpx","width":"100%","position":"relative","borderStyle":"solid","fontWeight":"600"}'>
					<view :style='{"color":"#23baf7","fontSize":"48rpx"}'>景区酒店推荐</view>
				</view>
				<!-- 样式1 -->
				<view class="list-box style1" :style='{"width":"100%","columnCount":"2","columnGap":"30rpx","height":"auto"}'>
					<view @tap="onDetailTap('scenicspothotels',product.id)" v-for="(product,index) in scenicspothotelslist" :key="index" class="list-item" :style='{"padding":"0 0 20rpx","margin":"0 0 40rpx","borderRadius":"20rpx","flexWrap":"wrap","background":"#fff","display":"flex","width":"auto","height":"auto"}'>
						<view :style='{"padding":"0 20rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#000","width":"100%","lineHeight":"1.8","fontSize":"28rpx","textOverflow":"ellipsis"}' class="list-item-title ">{{product.hotelname}}</view>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-if="product.hotelimage.substring(0,4)=='http'" :src="product.hotelimage"></image>
						<image :style='{"padding":"0","margin":"0","objectFit":"cover","borderRadius":"20rpx 20rpx 0 0","display":"block","width":"100%","height":"240rpx","order":"-1"}' class="list-item-image" mode="aspectFill" v-else :src="product.hotelimage?baseUrl+product.hotelimage.split(',')[0]:''"></image>
						<view :style='{"color":"#999","padding":"0 20rpx"}'>
							<text class="icon iconfont icon-shijian21" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.addtime.split(' ')[0].replace(/\-/g,'-')}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-shoucang10" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.storeupnum}}</text>
						</view>
						<view :style='{"color":"#dda53d","padding":"0 20rpx 0 0"}'>
							<text class="icon iconfont icon-chakan2" :style='{"margin":"0 4rpx 0 0","lineHeight":"1.5","fontSize":"inherit","color":"inherit"}'></text>
							<text :style='{"color":"inherit","lineHeight":"1.5","fontSize":"inherit"}'>{{product.clicknum}}</text>
						</view>
					</view>
				</view>
			</view>
			<!-- 商品推荐 -->
			
			<!-- 商品列表 -->
			<!-- 商品列表 -->
			<!-- 新闻资讯 -->
			<!-- 新闻资讯 -->
			<view v-if="scrollTop>200" @tap="scrollTopClick" :style='{"boxShadow":"0 8rpx 16rpx rgba(0,0,0,.3)","borderRadius":"50%","textAlign":"center","bottom":"20%","background":"#ff000030","width":"60rpx","lineHeight":"60rpx","position":"fixed","right":"20rpx","height":"60rpx","zIndex":"999"}'>
				<span class="icon iconfont icon-jiantou07" :style='{"color":"#fff"}'></span>
			</view>
		</view>
	</view>
</template>

<script>
    import menu from '@/utils/menu'
	import '@/assets/css/global-restaurant.css'
	import uniIcons from "@/components/uni-ui/lib/uni-icons/uni-icons.vue"
	export default {
		components: {
			uniIcons
		},
		data() {
			return {
				startX: 0,
				prevNumList4: '',
				numList4: 0,
				timerList4: null,
				flagList4: false,
				navigationActive: {"width":"16rpx","margin":"0 4rpx","borderRadius":"100%","background":"#23baf7","height":"16rpx"},
				navigationDefault: {"width":"16rpx","margin":"0 4rpx","borderRadius":"100%","background":"#fff","height":"16rpx"},
				options2: {
					effect: 'flip',
					loop : true
				},
				options3: {
					effect: 'cube',
					loop : true,
					cubeEffect: {
						shadow: true,
						slideShadows: true,
						shadowOffset: 20,
						shadowScale: 0.94,
					}
				},
				rows: 2,
				column: 4,
				iconArr: [
					'cuIcon-same',
					'cuIcon-deliver',
					'cuIcon-evaluate',
					'cuIcon-shop',
					'cuIcon-ticket',
					'cuIcon-cascades',
					'cuIcon-discover',
					'cuIcon-question',
					'cuIcon-pic',
					'cuIcon-filter',
					'cuIcon-footprint',
					'cuIcon-pulldown',
					'cuIcon-pullup',
					'cuIcon-moreandroid',
					'cuIcon-refund',
					'cuIcon-qrcode',
					'cuIcon-remind',
					'cuIcon-profile',
					'cuIcon-home',
					'cuIcon-message',
					'cuIcon-link',
					'cuIcon-lock',
					'cuIcon-unlock',
					'cuIcon-vip',
					'cuIcon-weibo',
					'cuIcon-activity',
					'cuIcon-friendadd',
					'cuIcon-friendfamous',
					'cuIcon-friend',
					'cuIcon-goods',
					'cuIcon-selection'
				],
				role : '',
				menuList: [],
				swiperMenuList:[],
				user: {},
				tableName:'',
				menuColor: '#23baf7,#44dadb,#042ead,#4b84e1,#6388fa,#ffbd65,#0fd38c,#52c9e1'.split(','),

				//轮播
				swiperList: [],
				scenicspotinformationlist: [],
				storeinformationlist: [],
				foodinformationlist: [],
				scenicspothotelslist: [],
				news: [],
				newsCateList2: [],
				newsIndex2: 0,
				scrollTop: 0,
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		},
		watch: {
		},
		mounted() {
		},
		computed: {
			baseUrl() {
				return this.$base.url;
			},
		},
		async onLoad(){
			this.menuColor = this.menuColor.sort(()=> {
				return (0.5-Math.random());
			});
		},
		async onShow() {
			if (this.timerList4&&this.timerList4!=null) clearInterval(this.timerList4)
			this.swiperMenuList = []
			this.role = uni.getStorageSync("appRole");
			let table = uni.getStorageSync("nowTable");
			let res = {}
			if(table) {
				res = await this.$api.session(table);
				this.user = res.data;
				this.tableName = table;
			}
			let menus = menu.list();
			this.menuList = menus;
			this.menuList.forEach((item,key) => {
				if(key==0) {
					item.frontMenu.forEach((item2,key2) => {
						if(item2.child[0].buttons.indexOf("查看")>-1) {
							this.swiperMenuList.push(item2);
						}
					})
				}
			})
			// let res;
			// 轮播图
			let swiperList = []
			res = await this.$api.list('config', {
				page: 1,
				limit: 5
			});
			for (let item of res.data.list) {
				if (item.name.indexOf('picture') >= 0 && item.value && item.value!="" && item.value!=null ) {
					swiperList.push({
						img: item.value,
						title: item.name,
						url: item.url
					});
				}
			}
			if (swiperList) {
				this.swiperList = swiperList;
			}
			
			this.prevNumList4 = this.swiperList.length - 1
			this.timerList4 = setInterval(this.autoPlayList4, 6000)

			// 推荐信息
			// 推荐信息
			// 推荐信息
			// 推荐信息
			this.getRecommendList()
			this.getHomeList()
			this.getNewsList()
		},
		methods: {
			scrollTopClick(){
				uni.pageScrollTo({
					scrollTop: 0
				})
			},
			uGetRect(selector, all) {
				return new Promise(resolve => {
					uni.createSelectorQuery()
					.in(this)
					[all ? 'selectAll' : 'select'](selector)
					.boundingClientRect(rect => {
						if (all && Array.isArray(rect) && rect.length) {
							resolve(rect);
						}
						if (!all && rect) {
							resolve(rect);
						}
					})
					.exec();
				});
			},
			cloneData(data) {
				return JSON.parse(JSON.stringify(data));
			},
			newsTabClick2(index){
				this.newsIndex2 = index
				this.getNewsList()
			},
			async getNewsList(){
				let res;
				let params = {
					page: 1,
					limit: 6,
					sort: 'id',
					order: 'desc',
				}
				if(this.newsIndex2){
					params.typename = this.newsCateList2[this.newsIndex2].typename
				}
			},
			homeTabClick2(index,name){
				this['home' + name + 'Index2'] = index
				this.getHomeList()
			},
			async getHomeList(){
				let res;
				let params;
			},
			recommendTabClick2(index,name){
				this[name + 'Index2'] = index
				this.getRecommendList()
			},
			async getRecommendList(){
				let res;
				let params;
				// 推荐信息
				params = {
					page: 1,
					limit: 6,
				}
				if(uni.getStorageSync("appUserid")) {
					res = await this.$api.recommend2('scenicspotinformation', params);
				} else {
					res = await this.$api.recommend('scenicspotinformation', params);
				}
				this.scenicspotinformationlist = res.data.list
				

				// 推荐信息
				params = {
					page: 1,
					limit: 6,
				}
				if(uni.getStorageSync("appUserid")) {
					res = await this.$api.recommend2('storeinformation', params);
				} else {
					res = await this.$api.recommend('storeinformation', params);
				}
				this.storeinformationlist = res.data.list
				

				// 推荐信息
				params = {
					page: 1,
					limit: 6,
				}
				if(uni.getStorageSync("appUserid")) {
					res = await this.$api.recommend2('foodinformation', params);
				} else {
					res = await this.$api.recommend('foodinformation', params);
				}
				this.foodinformationlist = res.data.list
				

				// 推荐信息
				params = {
					page: 1,
					limit: 6,
				}
				if(uni.getStorageSync("appUserid")) {
					res = await this.$api.recommend2('scenicspothotels', params);
				} else {
					res = await this.$api.recommend('scenicspothotels', params);
				}
				this.scenicspothotelslist = res.data.list
				

			},
			autoPlayList4() {
				this.prevNumList4 = this.numList4
			
				this.numList4++
				if (this.numList4 == this.swiperList.length) this.numList4 = 0
			},
			touchStart(event) {
				this.startX = event.touches[0].clientX
				
				clearInterval(this.timerList4)
				this.flagList4 = true
			},
			touchMove(event) {
				const currentX = event.touches[0].clientX;
				const deltaX = currentX - this.startX;
				
				if (deltaX > 50) {
					// 向右滑动逻辑
					if (this.flagList4) {
						this.flagList4 = false
						
						this.prevNumList4 = this.numList4
						this.numList4++
						if (this.numList4 == this.swiperList.length) this.numList4 = 0
					}
					
				} else if (deltaX < -50) {
					// 向左滑动逻辑
					if (this.flagList4) {
						this.flagList4 = false
						
						this.prevNumList4 = this.numList4
						this.numList4--
						if (this.numList4 < 0) this.numList4 = this.swiperList.length - 1
					}
				}
			},
			touchEnd() {
				this.startX = 0
				this.timerList4 = setInterval(this.autoPlayList4, 6000)
				this.flagList4 = false
			},
			//轮播图跳转
			onSwiperTap(e) {
				if(e.url) {
					if (e.url.indexOf('https') != -1) {
						// #ifdef MP-WEIXIN
						uni.navigateTo({
						    url: '../../common/linkOthers/linkOthers?url=' + encodeURIComponent(e.url),
						});
						return false
						// #endif
						window.open(e.url)
					} else {
						this.$utils.jump(e.url)
					}
				}
			},
			// 新闻详情
			onNewsDetailTap(id) {
				this.$utils.jump(`../news-detail/news-detail?id=${id}`)
			},
			// 推荐列表点击详情
			onDetailTap(tableName, id) {
				this.$utils.jump(`../${tableName}/detail?id=${id}`)
			},
			onPageTap(tableName){
				uni.navigateTo({
					url: `../${tableName}/list`,
					fail: function(){
						uni.switchTab({
							url: `../${tableName}/list`
						});
					}
				});
				// this.$utils.jump(`../${tableName}/list`)
			},
			onPageTap2(index) {
				let url = '../' + index + '/list'
				if(index=='kefuguanli') {
					url = '../chat/chat'
				}
				uni.setStorageSync("useridTag",0);
				uni.navigateTo({
					url: url,
					fail: function() {
						uni.switchTab({
							url: url
						});
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: calc(100vh - 44px);
		box-sizing: border-box;
	}
	.list-swiper-4 .animate__animated {
		--animate-delay: 300ms;
	}

	.news {
		.style2 {
			.tabView {
				.tab {
					border-radius: 0px;
					padding: 0 30rpx;
					margin: 0;
					color: #888;
					background: none;
					width: 50%;
					text-align: center;
				}
				.tabActive {
					border-radius: 0px;
					padding: 0 20rpx;
					margin: 0;
					color: #23baf6;
					background: #f6f8ff;
					width: 50%;
					text-align: center;
				}
			}
		}
	}
	.menu_view {
		border-radius: 20rpx;
		padding: 0;
		margin: 20rpx auto 0;
		background: #fff;
		display: flex;
		width: calc(100% - 48rpx);
		flex-wrap: wrap;
		height: auto;
		.menu-item {
			border-radius: 8rpx;
			padding: 12rpx 0;
			margin: 10rpx 0px;
			width: calc(25% - 0px);
			height: auto;
			.iconarr {
				border-radius: 20rpx;
				padding: 0;
				margin: 0px auto;
				color: #fff;
				background: none;
				display: block;
				width: 96rpx;
				font-size: 64rpx;
				line-height: 96rpx;
				text-align: center;
				height: 96rpx;
			}
			.text {
				padding: 0;
				margin: 12rpx auto 0;
				color: #333;
				width: 100%;
				font-size: 26rpx;
				line-height: 28rpx;
				text-align: center;
			}
		}
	}
</style>
